/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.biodas.jdas.creators;

import java.util.List;
import org.biodas.jdas.schema.stylesheet.*;

/**
 *
 * @author jw12
 */
public class CreateStylesheet {

    ObjectFactory factory = new ObjectFactory();
    
    public BOX createBox(){
        BOX box=factory.createBOX();
        return box;
    }
    /**
     * There are loads of set methods for a glyph so can't really create a convenience method here so we need to set after getting the glyph from this method
     * @return 
     */
    public GLYPH createGlyph(){
        GLYPH glyph=factory.createGLYPH();
        return glyph;
        
    }
    public TYPE createType(String id, List<GLYPH> glyphs){
        TYPE type = factory.createTYPE();
        type.setId(id);
        for(GLYPH glyph: glyphs){
        type.getGLYPH().add(glyph);
        }
        return type;
    }

    public STYLESHEET createStyleSheet(List<CATEGORY> catagories) {
        STYLESHEET styleSheet = factory.createSTYLESHEET();
        for (CATEGORY cat : catagories) {
            styleSheet.getCATEGORY().add(cat);
        }
        return styleSheet;
    }

    public DASSTYLE createDasStyle(STYLESHEET stylesheet) {
        DASSTYLE dasStyle = factory.createDASSTYLE();
        dasStyle.setSTYLESHEET(stylesheet);
        return dasStyle;
    }

    public CATEGORY createCategory(List<TYPE> types) {
        CATEGORY category = factory.createCATEGORY();
        for(TYPE type:types){
            category.getTYPE().add(type);
        }
        
        return category;
    }
}
